/*
 * Copyright (c) 2023, LXMS (lxinet.cn).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.lxinet.lxms.framework.core.message;

/**
 * 常见错误码
 *
 * @author zcx
 * @date 2023/07/12
 */
public enum CommonErrorCode implements ErrorCode{

    SUCCESS(0, "操作成功"),
    FAIL(10000001, "操作失败"),
    SYSTEM_EXCEPTION(10000002, "系统异常"),
    PARAM_ERROR(10000003, "参数错误"),
    RSA_ENCRYPT_ERROR(10000004, "RSA加密失败"),
    RSA_DECRYPT_ERROR(10000005, "RSA解密失败"),
    AUTHORIZATION_CANNOT_EMPTY(10000006, "Authorization不能为空"),
    AUTHORIZATION_EXPIRED(10000007, "登录超时，请重新登录"),
    ACCESS_DENIED(10000008, "无权限"),
    DEMO_ENV_IS_NOT_OPER(10000009, "演示环境无法操作"),
    ;

    private Integer code;
    private String msg;

    CommonErrorCode(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
